<template>
  <div class="descriptions">
    <el-descriptions class="margin-top" :title="title" :column="column" border>
      <template v-for="item in tableDatas" :key="item.name">
        <el-descriptions-item>
          <template #label>
            <div>{{ item.name }}</div>
          </template>
          <el-tag>{{ item.description }}</el-tag>
        </el-descriptions-item>
      </template>
    </el-descriptions>
  </div>
</template>

<script setup lang="ts">
import { defineProps, withDefaults } from 'vue'
import type { IDescriptions } from '../types'
withDefaults(
  defineProps<{
    title?: string
    column?: number
    tableDatas: IDescriptions[]
  }>(),
  {
    title: '',
    column: 2
  }
)
</script>

<style lang="less" scoped>
.margin-top {
  margin-top: 20px;
}
</style>
